package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.android.common.util.SPUtil;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/6/15.
 * 阅片包月时间列表
 */

public class YuePianTimeApi extends BaseApi {
    YuePianTimeReq req;

    public YuePianTimeApi(int page_num) {
        req = new YuePianTimeReq(page_num);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).orderlistyuepiantime(requestBody);
    }

    class YuePianTimeReq {
        /**
         * page_num : 0
         * link_mobile : 13263266381
         */

        private int page_num;
        private String link_mobile;

        public YuePianTimeReq(int page_num) {
            this.page_num = page_num;
            this.link_mobile = SPUtil.getPersonInfoSp().getString(SPUtil.SPPersonInfo.LINK_MOBILE, "");
        }
    }
}
